﻿using Bentley.DgnPlatformNET;
using Bentley.DgnPlatformNET.Elements;
using Bentley.GeometryNET;
using Bentley.MstnPlatformNET;
using CheccCoverplateCulvertAssemble.Common.Total;
using CheccCoverplateCulvertAssemble.Tools;
using System;
using System.Collections.Generic;

namespace CheccFillTheChute.Operation
{
    internal class HeadFall
    {
        private readonly HeadFallBase headFallBase;
        //洞口宽度
        private readonly double holeWidth;
        //洞口夹角
        private readonly double heleAngle;
        public HeadFall(HeadFallBase headFallBase,double holeWidth, double heleAngle) 
        {
            this.headFallBase = headFallBase;
            this.holeWidth = holeWidth;
            this.heleAngle = heleAngle;
        }

        public Element CreateEntityModel()
        {
            var objParameter = GetUorCoverParameter();
            //排水沟深度+铺底厚度
            double height = objParameter.gutterwayDepth + objParameter.paveBottomThickness;
            double length = objParameter.paveBottomThickness * objParameter.gutterwaySlopeRatio;
            double slope = Math.Abs(objParameter.endlongSlope * 0.01);
            objParameter.angleFlare *= 0.01;
            //洞口内侧
            DPoint3d[] dPInside =
            {
                new DPoint3d(0,holeWidth * 0.5 + objParameter.sideWiden,objParameter.paveBottomThickness)*GeneralBank.UorToMeters,
                new DPoint3d(0,holeWidth * 0.5 + objParameter.sideWiden+objParameter.gutterwayDepth*objParameter.gutterwaySlopeRatio,height)*GeneralBank.UorToMeters ,
                new DPoint3d(0,holeWidth * 0.5 + objParameter.sideWiden+objParameter.gutterwayDepth*objParameter.gutterwaySlopeRatio+objParameter.gutterrwayWallWidth,height)*GeneralBank.UorToMeters ,
                new DPoint3d(0,holeWidth * 0.5 + objParameter.sideWiden+objParameter.gutterrwayWallWidth-length,0)*GeneralBank.UorToMeters ,
                new DPoint3d(0,-(holeWidth * 0.5+objParameter.sideWiden+objParameter.gutterrwayWallWidth-length),0)*GeneralBank.UorToMeters ,
                new DPoint3d(0,-(holeWidth * 0.5+objParameter.sideWiden+objParameter.gutterwayDepth*objParameter.gutterwaySlopeRatio+objParameter.gutterrwayWallWidth),height)*GeneralBank.UorToMeters ,
                new DPoint3d(0,-(holeWidth * 0.5 + objParameter.sideWiden+objParameter.gutterwayDepth*objParameter.gutterwaySlopeRatio),height)*GeneralBank.UorToMeters ,
                new DPoint3d(0,-(holeWidth * 0.5 + objParameter.sideWiden),objParameter.paveBottomThickness)*GeneralBank.UorToMeters ,
            };
            //洞口外侧

            DPoint3d[] dPOutside =
            {
                new DPoint3d(objParameter.paveLength, (1 + objParameter.angleFlare) * dPInside[0].Y/GeneralBank.UorToMeters, dPInside[0].Z/GeneralBank.UorToMeters - ((objParameter.paveLength) * slope))*GeneralBank.UorToMeters,
                new DPoint3d(objParameter.paveLength, (1 + objParameter.angleFlare) * dPInside[1].Y/GeneralBank.UorToMeters, dPInside[0].Z/GeneralBank.UorToMeters - objParameter.paveLength * slope + objParameter.gutterwayDepth)*GeneralBank.UorToMeters,
                new DPoint3d(objParameter.paveLength, (1 + objParameter.angleFlare) * dPInside[2].Y/GeneralBank.UorToMeters, dPInside[0].Z/GeneralBank.UorToMeters - objParameter.paveLength * slope + objParameter.gutterwayDepth)*GeneralBank.UorToMeters,
                new DPoint3d(objParameter.paveLength, (1 + objParameter.angleFlare) * dPInside[3].Y/GeneralBank.UorToMeters, dPInside[0].Z/GeneralBank.UorToMeters - objParameter.paveLength * slope - objParameter.paveBottomThickness)*GeneralBank.UorToMeters,
                new DPoint3d(objParameter.paveLength, (1 + objParameter.angleFlare) * dPInside[4].Y/GeneralBank.UorToMeters, dPInside[0].Z/GeneralBank.UorToMeters - objParameter.paveLength * slope - objParameter.paveBottomThickness)*GeneralBank.UorToMeters,
                new DPoint3d(objParameter.paveLength, (1 + objParameter.angleFlare) * dPInside[5].Y/GeneralBank.UorToMeters, dPInside[0].Z/GeneralBank.UorToMeters - objParameter.paveLength * slope + objParameter.gutterwayDepth)*GeneralBank.UorToMeters,
                new DPoint3d(objParameter.paveLength, (1 + objParameter.angleFlare) * dPInside[6].Y/GeneralBank.UorToMeters, dPInside[0].Z/GeneralBank.UorToMeters - objParameter.paveLength * slope + objParameter.gutterwayDepth)*GeneralBank.UorToMeters,
                new DPoint3d(objParameter.paveLength, (1 + objParameter.angleFlare) * dPInside[7].Y/GeneralBank.UorToMeters, dPInside[0].Z/GeneralBank.UorToMeters - objParameter.paveLength * slope)*GeneralBank.UorToMeters
            };

            double LeftLateralOffset1 = Math.Abs((holeWidth / 2 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length) * Math.Tan((90 - heleAngle) * Math.PI / 180));
            double LeftLateralOffset2 = Math.Abs((holeWidth / 2 + objParameter.sideWiden) * Math.Tan((90 - heleAngle) * Math.PI / 180));
            double LeftLateralOffset3 = Math.Abs((holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio) * Math.Tan((90 - heleAngle) * Math.PI / 180));
            double LeftLateralOffset4 = Math.Abs((holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth) * Math.Tan((90 - heleAngle) * Math.PI / 180));

            if (heleAngle < 90)
            {
                LeftLateralOffset1 = (-LeftLateralOffset1);
                LeftLateralOffset2 = (-LeftLateralOffset2);
                LeftLateralOffset3 = (-LeftLateralOffset3);
                LeftLateralOffset4 = (-LeftLateralOffset4);
                //洞口内侧
                dPInside[0] = new DPoint3d(0 - LeftLateralOffset2, holeWidth * 0.5 + objParameter.sideWiden, objParameter.paveBottomThickness + LeftLateralOffset2 * slope) * GeneralBank.UorToMeters;
                dPInside[1] = new DPoint3d(0 - LeftLateralOffset3, holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio, height + LeftLateralOffset3 * slope) * GeneralBank.UorToMeters;
                dPInside[2] = new DPoint3d(0 - LeftLateralOffset4, holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth, height + LeftLateralOffset4 * slope) * GeneralBank.UorToMeters;
                dPInside[3] = new DPoint3d(0 - LeftLateralOffset1, holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length, LeftLateralOffset1 * slope) * GeneralBank.UorToMeters;
                dPInside[4] = new DPoint3d(0 + LeftLateralOffset1, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length), LeftLateralOffset1 * slope) * GeneralBank.UorToMeters;
                dPInside[5] = new DPoint3d(0 + LeftLateralOffset4, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth), height + LeftLateralOffset4 * slope) * GeneralBank.UorToMeters;
                dPInside[6] = new DPoint3d(0 + LeftLateralOffset3, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio), height + LeftLateralOffset3 * slope) * GeneralBank.UorToMeters;
                dPInside[7] = new DPoint3d(0 + LeftLateralOffset2, -(holeWidth * 0.5 + objParameter.sideWiden), objParameter.paveBottomThickness + LeftLateralOffset2 * slope) * GeneralBank.UorToMeters;
                //洞口外侧
                dPOutside[0] = new DPoint3d(0 - LeftLateralOffset2 + objParameter.paveLength, (holeWidth * 0.5 + objParameter.sideWiden) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset2 * slope - (objParameter.paveLength * slope)) * GeneralBank.UorToMeters;
                dPOutside[1] = new DPoint3d(0 - LeftLateralOffset3 + objParameter.paveLength, (holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio) * (1 + objParameter.angleFlare), height + LeftLateralOffset3 * slope - (objParameter.paveLength * slope)) * GeneralBank.UorToMeters;
                dPOutside[2] = new DPoint3d(0 - LeftLateralOffset4 + objParameter.paveLength, (holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset4 * slope - objParameter.paveLength * slope + objParameter.gutterwayDepth) * GeneralBank.UorToMeters;
                dPOutside[3] = new DPoint3d(0 - LeftLateralOffset1 + objParameter.paveLength, (holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset1 * slope - objParameter.paveLength * slope - objParameter.paveBottomThickness) * GeneralBank.UorToMeters;
                dPOutside[4] = new DPoint3d(0 + LeftLateralOffset1 + objParameter.paveLength, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset1 * slope - objParameter.paveLength * slope - objParameter.paveBottomThickness) * GeneralBank.UorToMeters;
                dPOutside[5] = new DPoint3d(0 + LeftLateralOffset4 + objParameter.paveLength, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset4 * slope - objParameter.paveLength * slope + objParameter.gutterwayDepth) * GeneralBank.UorToMeters;
                dPOutside[6] = new DPoint3d(0 + LeftLateralOffset3 + objParameter.paveLength, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio) * (1 + objParameter.angleFlare), height + LeftLateralOffset3 * slope - (objParameter.paveLength * slope)) * GeneralBank.UorToMeters;
                dPOutside[7] = new DPoint3d(0 + LeftLateralOffset2 + objParameter.paveLength, -(holeWidth * 0.5 + objParameter.sideWiden) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset2 * slope - (objParameter.paveLength * slope)) * GeneralBank.UorToMeters;

            }
            else if (heleAngle > 90)
            {

                //洞口内侧
                dPInside[0] = new DPoint3d(0 - LeftLateralOffset2, holeWidth * 0.5 + objParameter.sideWiden, objParameter.paveBottomThickness + LeftLateralOffset2 * slope) * GeneralBank.UorToMeters;
                dPInside[1] = new DPoint3d(0 - LeftLateralOffset3, holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio, height + LeftLateralOffset3 * slope) * GeneralBank.UorToMeters;
                dPInside[2] = new DPoint3d(0 - LeftLateralOffset4, holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth, height + LeftLateralOffset4 * slope) * GeneralBank.UorToMeters;
                dPInside[3] = new DPoint3d(0 - LeftLateralOffset1, holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length, LeftLateralOffset1 * slope) * GeneralBank.UorToMeters;
                dPInside[4] = new DPoint3d(0 + LeftLateralOffset1, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length), LeftLateralOffset1 * slope) * GeneralBank.UorToMeters;
                dPInside[5] = new DPoint3d(0 + LeftLateralOffset4, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth), height + LeftLateralOffset4 * slope) * GeneralBank.UorToMeters;
                dPInside[6] = new DPoint3d(0 + LeftLateralOffset3, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio), height + LeftLateralOffset3 * slope) * GeneralBank.UorToMeters;
                dPInside[7] = new DPoint3d(0 + LeftLateralOffset2, -(holeWidth * 0.5 + objParameter.sideWiden), objParameter.paveBottomThickness + LeftLateralOffset2 * slope) * GeneralBank.UorToMeters;
                //洞口外侧
                dPOutside[0] = new DPoint3d(0 - LeftLateralOffset2 + objParameter.paveLength, (holeWidth * 0.5 + objParameter.sideWiden) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset2 * slope - (objParameter.paveLength * slope)) * GeneralBank.UorToMeters;
                dPOutside[1] = new DPoint3d(0 - LeftLateralOffset3 + objParameter.paveLength, (holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio) * (1 + objParameter.angleFlare), height + LeftLateralOffset3 * slope - (objParameter.paveLength * slope)) * GeneralBank.UorToMeters;
                dPOutside[2] = new DPoint3d(0 - LeftLateralOffset4 + objParameter.paveLength, (holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset4 * slope - objParameter.paveLength * slope + objParameter.gutterwayDepth) * GeneralBank.UorToMeters;
                dPOutside[3] = new DPoint3d(0 - LeftLateralOffset1 + objParameter.paveLength, (holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset1 * slope - objParameter.paveLength * slope - objParameter.paveBottomThickness) * GeneralBank.UorToMeters;
                dPOutside[4] = new DPoint3d(0 + LeftLateralOffset1 + objParameter.paveLength, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterrwayWallWidth - length) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset1 * slope - objParameter.paveLength * slope - objParameter.paveBottomThickness) * GeneralBank.UorToMeters;
                dPOutside[5] = new DPoint3d(0 + LeftLateralOffset4 + objParameter.paveLength, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio + objParameter.gutterrwayWallWidth) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset4 * slope - objParameter.paveLength * slope + objParameter.gutterwayDepth) * GeneralBank.UorToMeters;
                dPOutside[6] = new DPoint3d(0 + LeftLateralOffset3 + objParameter.paveLength, -(holeWidth * 0.5 + objParameter.sideWiden + objParameter.gutterwayDepth * objParameter.gutterwaySlopeRatio) * (1 + objParameter.angleFlare), height + LeftLateralOffset3 * slope - (objParameter.paveLength * slope)) * GeneralBank.UorToMeters;
                dPOutside[7] = new DPoint3d(0 + LeftLateralOffset2 + objParameter.paveLength, -(holeWidth * 0.5 + objParameter.sideWiden) * (1 + objParameter.angleFlare), objParameter.paveBottomThickness + LeftLateralOffset2 * slope - (objParameter.paveLength * slope)) * GeneralBank.UorToMeters;
            }

            ShapeElement shapeElement1 = new(GeneralBank.ActiveDgnModel, null, dPInside);
            ShapeElement shapeElement2 = new(GeneralBank.ActiveDgnModel, null, dPOutside);
            var internalSections = new List<CurveVector>
            {
                shapeElement1.GetCurveVector(),
                shapeElement2.GetCurveVector()
            };
            Create.BodyFromLoft(out SolidKernelEntity entityOut, internalSections.ToArray(), internalSections.Count, internalSections.ToArray(), 0, GeneralBank.ActiveDgnModel, false, false);
            #region 截水
            DPoint3d dPoint3D = new DPoint3d(dPOutside[4].X, dPOutside[4].Y, dPOutside[4].Z - objParameter.cutoffWallHeight * GeneralBank.UorToMeters);
            DPoint3d dPoint3D1 = new DPoint3d(dPoint3D.X - objParameter.cutoffWallThickness * GeneralBank.UorToMeters, dPoint3D.Y, dPoint3D.Z);
            DPoint3d dPoint3D3 = new DPoint3d(dPOutside[3].X, dPOutside[3].Y, dPOutside[3].Z - objParameter.cutoffWallHeight * GeneralBank.UorToMeters);
            DPoint3d dPoint3D4 = new DPoint3d(dPoint3D3.X - objParameter.cutoffWallThickness * GeneralBank.UorToMeters, dPoint3D3.Y, dPoint3D3.Z);

            DPoint3d[] dPoint3Ds =
            {
                new DPoint3d(objParameter.paveLength* GeneralBank.UorToMeters, (1 + objParameter.angleFlare) * dPInside[3].Y, dPOutside[0].Z - objParameter.paveBottomThickness* GeneralBank.UorToMeters),
                new DPoint3d(dPoint3D4.X, dPoint3D4.Y- 320, dPoint3D4.Z + objParameter.cutoffWallHeight* GeneralBank.UorToMeters + objParameter.cutoffWallThickness* GeneralBank.UorToMeters * slope),
                new DPoint3d(dPoint3D3.X - objParameter.cutoffWallThickness* GeneralBank.UorToMeters, dPoint3D3.Y- 320, dPoint3D3.Z),
                new DPoint3d(dPOutside[3].X, dPOutside[3].Y, dPOutside[3].Z - objParameter.cutoffWallHeight* GeneralBank.UorToMeters)
            };
            DPoint3d[] dPoint2Ds =
            {
                new DPoint3d(objParameter.paveLength* GeneralBank.UorToMeters, (1 + objParameter.angleFlare) * dPInside[4].Y, dPOutside[0].Z - objParameter.paveBottomThickness* GeneralBank.UorToMeters),
                new DPoint3d(dPoint3D1.X, dPoint3D1.Y + 320, dPoint3D1.Z + objParameter.cutoffWallHeight* GeneralBank.UorToMeters + objParameter.cutoffWallThickness* GeneralBank.UorToMeters * slope),
                new DPoint3d(dPoint3D.X - objParameter.cutoffWallThickness* GeneralBank.UorToMeters, dPoint3D.Y + 320, dPoint3D.Z),
                new DPoint3d(dPOutside[4].X, dPOutside[4].Y, dPOutside[4].Z - objParameter.cutoffWallHeight* GeneralBank.UorToMeters)
            };

            if (heleAngle != 90)
            {
                DVector3d.TryNormalizeToTarget(dPInside[4], dPOutside[4], out DVector3d unitVector);
                DPoint3d translationStartDP = dPOutside[4];
                translationStartDP.Z = dPOutside[4].Z - objParameter.cutoffWallHeight * GeneralBank.UorToMeters;
                DPoint3d translationEndDP = translationStartDP + objParameter.cutoffWallThickness * GeneralBank.UorToMeters * -unitVector;
                DPoint3d translationStartDP2 = dPOutside[4];
                translationStartDP2.Z = dPOutside[4].Z;
                DPoint3d translationEndDP2 = translationStartDP2 + objParameter.cutoffWallThickness * GeneralBank.UorToMeters * -unitVector;

                dPoint3Ds[0] = translationStartDP;
                dPoint3Ds[1] = new DPoint3d(translationEndDP.X, translationEndDP.Y, translationEndDP.Z - 640);
                dPoint3Ds[2] = translationEndDP2;
                dPoint3Ds[3] = dPOutside[4];

                DVector3d.TryNormalizeToTarget(dPInside[3], dPOutside[3], out DVector3d unitVector2);
                DPoint3d translation2StartDP = dPOutside[3];
                translation2StartDP.Z = dPOutside[3].Z - objParameter.cutoffWallHeight * GeneralBank.UorToMeters;
                DPoint3d translation2EndDP = translation2StartDP + objParameter.cutoffWallThickness * GeneralBank.UorToMeters * -unitVector2;
                DPoint3d translation2StartDP2 = dPOutside[3];
                translation2StartDP2.Z = dPOutside[3].Z;
                DPoint3d translation2EndDP2 = translation2StartDP2 + objParameter.cutoffWallThickness * GeneralBank.UorToMeters * -unitVector2;

                dPoint2Ds[0] = translation2StartDP;
                dPoint2Ds[1] = new DPoint3d(translation2EndDP.X, translation2EndDP.Y, translation2EndDP.Z - 640);
                dPoint2Ds[2] = translation2EndDP2;
                dPoint2Ds[3] = dPOutside[3];
            }
            ShapeElement shape1 = new(GeneralBank.ActiveDgnModel, null, dPoint3Ds);
            //shape1.AddToModel();
            ShapeElement shape2 = new(GeneralBank.ActiveDgnModel, null, dPoint2Ds);

            var internalSections2 = new List<CurveVector>
            {
                shape1.GetCurveVector(),
                shape2.GetCurveVector()
            };
            Create.BodyFromLoft(out SolidKernelEntity entityOut1, internalSections2.ToArray(), internalSections2.Count, internalSections2.ToArray(), 0, GeneralBank.ActiveDgnModel, false, false);
            #endregion

            List<SolidKernelEntity> solidKernelEntities = new()
            {
                entityOut,entityOut1
            };
            //solidKernelEntities.Add(bodySolid[0]);
            SolidKernelEntity[] tools = solidKernelEntities.ToArray();
            SolidKernelEntity target = entityOut1;
            Bentley.CIMNET.CIMGeometry.Solid.SolidUtil.Modify.BodyBooleanUnion(ref target, ref tools, 1);
            Convert1.BodyToElement(out Element resultSolid, target, null, GeneralBank.ActiveDgnModel);

            //位移
            DPoint3d movePt = new DPoint3d(0, 0, -objParameter.paveBottomThickness) * GeneralBank.UorToMeters; ;
            DTransform3d trans = new DTransform3d(DMatrix3d.Identity);
            trans.Translation = movePt;
            resultSolid.ApplyTransform(new TransformInfo(trans));
            return resultSolid;
        }

        private (double angleFlare, double endlongSlope, double sideWiden, double cutoffWallThickness, double paveBottomThickness, double height, double paveLength, double cutoffWallHeight, double gutterwayDepth, double gutterrwayWallWidth, double gutterwaySlopeRatio) GetUorCoverParameter() 
        {
            double angleFlare = this.headFallBase._angleFlare;
            double endlongSlope = this.headFallBase._endlongSlope/100;
            double sideWiden = this.headFallBase._sideWiden / 100;
            double cutoffWallThickness =    this.headFallBase._cutoffWallThickness / 100;
            double paveBottomThickness = this.headFallBase._paveBottomThickness / 100;
            double height = this.headFallBase._height / 100;
            double paveLength = this.headFallBase._paveLength / 100;
            double cutoffWallHeight = this.headFallBase._cutoffWallHeight / 100;
            double gutterwayDepth = this.headFallBase._gutterwayDepth / 100;
            double gutterrwayWallWidth = this.headFallBase._gutterrwayWallWidth / 100;
            double gutterwaySlopeRatio = this.headFallBase._gutterwaySlopeRatio;
            return (angleFlare,endlongSlope,sideWiden,cutoffWallThickness,paveBottomThickness,height, paveLength, cutoffWallHeight, gutterwayDepth, gutterrwayWallWidth, gutterwaySlopeRatio);
        }
    }
}
